#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
void judge(int x, int y, int z);//函数声明

int main()
{
	int year = 0;
	int month = 0;
	int day = 0;
	printf("Please input data:\n");
	scanf("%d %d %d", &year, &month, &day);
	judge(year, month, day);
	return 0;
}
void judge(int x ,int y ,int z)
{
	int sum = 0;
	if ((0 == x % 4 && 0 != x % 100) || (0 == x % 400))//闰年
	{
		if (1 == y)
		{
			sum = z;
		}
		if (2 == y)
		{
			sum = (y-1)*31+z;
		}
		if (3 == y)
		{
			sum = (y - 1) * 31 + 29+z;
		}
		if (4 == y)
		{
			sum = 31 * 2 + 29 + z;
		}
		if (5 == y)
		{
			sum = 31 * 2 + 29 + 30 * 1 + z;
		}
		if (6 == y)
		{
			sum = 31 * 3 + 30 * 1 + 29 + z;
		}
		if (7 == y)
		{
			sum = 31 * 3 + 30 * 2 + 29 + z;
		}
		if (8 == y)
		{
			sum = 31 * 4 + 30 * 2 + 29 + z;
		}
		if (9 == y)
		{
			sum = 31 * 5 + 30 * 2 + 29 + z;
		}
		if (10 == y)
		{
			sum = 31 * 5 + 30 * 3 + 29 + z;
		}
		if (11 == y)
		{
			sum = 31 * 6 + 30 * 3 + 29 + z;
		}
		if (12 == y)
		{
			sum = 31 * 6 + 30 * 4 + 29 + z;
		}
		printf("%d年%d月%d日是该年的第%d天\n", x, y, z, sum);
	}
	else//平年
	{
		if (1 == y)
		{
			sum = z;
		}
		if (2 == y)
		{
			sum = (y - 1) * 31 + z;
		}
		if (3 == y)
		{
			sum = (y - 1) * 31 + 28 + z;
		}
		if (4 == y)
		{
			sum = 31 * 2 + 28 + z;
		}
		if (5 == y)
		{
			sum = 31 * 2 + 30 * 1 + 28 + z;
		}
		if (6 == y)
		{
			sum = 31 * 3 + 30 * 1 + 28 + z;
		}
		if (7 == y)
		{
			sum = 31 * 3 + 30 * 2 + 28 + z;
		}
		if (8 == y)
		{
			sum = 31 * 4 + 30 * 2 + 28 + z;
		}
		if (9 == y)
		{
			sum = 31 * 5 + 30 * 2 + 28 + z;
		}
		if (10 == y)
		{
			sum = 31 * 5 + 30 * 3 + 28 + z;
		}
		if (11 == y)
		{
			sum = 31 * 6 + 30 * 3 + 28 + z;
		}
		if (12 == y)
		{
			sum = 31 * 6 + 30 * 4 + 28 + z;
		}
		printf("%d年%d月%d日是该年的第%d天\n", x, y, z, sum);
	}
}